<template>
    <div>
      <h3>父</h3>
      <h3>书籍：{{sum}}</h3>
      <h3>我有一辆{{car.c1}}和一辆{{car.c2}}</h3>
      <Son />
    </div>
  </template>
  
  <script setup lang='ts' nmae="Father">
  import { ref, reactive, provide } from 'vue'
  import Son from './Son.vue';

  let sum = ref(100)
  let car = reactive({
    c1:"自行车",
    c2:"摩托车"
  })
  function buyBook(val:number){
    sum.value += val
  }
  provide('aa',{sum,buyBook})
  provide('bbb',car)
  </script>
  
  
  <style lang='scss' scoped>
  
  </style>